<template>
  <span class="iconfont" :class="iconClass" ></span></template>

<script>
import "@/assets/document/iconfont.css"
export default {
  name: 'FileTypeIcon',
  props: {
    type: {
      type: String,
      required: true
    }
  },
  computed: {
    iconClass() {
      const type = this.type.toLowerCase();
      const iconMap = {
        'pdf': 'el-PDF',
        'doc': 'el-word',
        'docx': 'el-word',
        'xls': 'el-excel',
        'xlsx': 'el-excel',
        'ppt': 'el-PPT',
        'pptx': 'el-PPT',
      };
      return iconMap[type] || 'el-wendang';
    },
  }
};
</script>

<style scoped>
</style>
